package com.example.starter.exception;

import org.springframework.http.HttpStatus;

/**
 * Created by liuw on 2017/11/15.
 */
public enum ErrorCode {
    // * 0 ~ 1000, system error
    UNKNOWN(100000001, "系统未知错误"),
    PARAMETER_NOT_NULL(7, "参数不能为空"),
    BEAN_VALIDATION_ERROR(8, "参数不能为空"),
    RESOURCE_NOT_FOUND(100000002, "未找到资源");

    private final int code;

    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }


    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "ErrorCode{"
                + "code=" + code
                + ", message='" + message + '\''
                + '}';
    }

}
